{template 'common/header'}
<ul class="nav nav-tabs">
    <li class="active"><a href="{php echo $this->createWebUrl('api');}">接口参数</a></li>
</ul>
<script>
    require(['jquery', 'util'], function($, u) {
        $(function(){
            $('#theform').submit(function(){
                var message = '';
                if($.trim($(':text[name=appid]').val()) == '') {
                    message += '必须输入AppID<br>';
                }
                if($.trim($(':text[name=secret]').val()) == '') {
                    message += '必须输入AppSecret<br>';
                }
                if($.trim($(':text[name=mchid]').val()) == '') {
                    message += '必须输入微信支付商户号<br>';
                }
                if($.trim($(':text[name=password]').val()) == '') {
                    message += '必须输入微信支付商户密钥<br>';
                }
                if(message) {
                    u.message(message);
                    return false;
                }
                return true;
            });
        });
    });
</script>
<div class="clearfix">
    <form id="theform" class="form form-horizontal" action="" method="post">
        <div class="panel panel-default">
            <div class="panel-heading">
                发企业现金付款的接口参数
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
                    <div class="col-sm-9 col-xs-12">
                        <div class="alert alert-info">
                            发放企业现金付款需要使用 <br>
                            <span class="label label-info">认证服务号并开通微信支付</span> <br>
                            如果账号是订阅号也可以借用别人的账号
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">AppID</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="appid" value="{$settings['appid']}" class="form-control">
                        <span class="help-block">使用或借用的认证服务号AppID</span>
                        <span class="help-block"><strong>设置好以后请不要更换, 否则会造成重复领取红包</strong></span>
                        <span class="help-block"><strong>请在公众平台中设置oAuth授权域名为当前系统域名, <a href="http://mp.weixin.qq.com/" target="_blank">去设置</a></strong></span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">AppSecret</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="secret" value="{$settings['secret']}" class="form-control">
                        <span class="help-block">使用或借用的认证服务号AppSecret, 需要使用高级接口鉴权</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">商户号</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="mchid" value="{$settings['mchid']}" class="form-control">
                        <span class="help-block">使用或借用的微信支付商户号, 开通微信支付才能获得商户号</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">商户支付密钥</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="password" value="{$settings['password']}" class="form-control">
                        <span class="help-block">使用或借用的微信支付商户所使用的支付密钥, 开通微信支付才能获得商户号</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">服务器IP</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="ip" value="{$settings['ip']}" class="form-control">
                        <span class="help-block">发放红包接口需要服务器IP. 程序将自动获取你的服务器IP, 如果获取失败, 请手动指定</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">商户支付证书</label>
                    <div class="col-sm-9 col-xs-12">
                        <textarea class="form-control" name="cert" rows="8" placeholder="为保证安全性, 不显示证书内容. 若要修改, 请直接输入"></textarea>
                        <span class="help-block">从商户平台上下载支付证书, 解压并取得其中的 <mark>apiclient_cert.pem</mark> 用记事本打开并复制文件内容, 填至此处</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">支付证书私钥</label>
                    <div class="col-sm-9 col-xs-12">
                        <textarea class="form-control" name="key" rows="8" placeholder="为保证安全性, 不显示证书内容. 若要修改, 请直接输入"></textarea>
                        <span class="help-block">从商户平台上下载支付证书, 解压并取得其中的 <mark>apiclient_key.pem</mark> 用记事本打开并复制文件内容, 填至此处</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">支付根证书</label>
                    <div class="col-sm-9 col-xs-12">
                        <textarea class="form-control" name="ca" rows="8" placeholder="为保证安全性, 不显示证书内容. 若要修改, 请直接输入"></textarea>
                        <span class="help-block">从商户平台上下载支付证书, 解压并取得其中的 <mark>rootca.pem</mark> 用记事本打开并复制文件内容, 填至此处</span>
                    </div>
                </div>
                
                 <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">红包额度</label>
                    <div class="col-sm-9 col-xs-12">
                                                最小金额<input type="text" name="min_amount" value="{$settings['min_amount']}" class="form-control">
                                                   最大金额<input type="text" name="max_amount" value="{$settings['max_amount']}" class="form-control">
                                                    
                   红包提示语<input type="text" name="notice" value="{$settings['notice']}" placeholder="请添加xxx微信个人号，领取更多福利" class="form-control">
                       <span class="help-block">红包的最大最小金额(分为单位)</span>
                    </div>
                </div>
                
                   <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">推荐别人获得的红包额度</label>
                    <div class="col-sm-9 col-xs-12">
                        金额<input type="text" name="tj_amount" value="{$settings['tj_amount']}" class="form-control">
          
                        <span class="help-block">红包的金额(分为单位)</span>
                    </div>
                </div>
                
                
                
                 <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">红包头像</label>
                    <div class="col-xs-12 col-sm-9">
                         {php echo tpl_form_field_image('tx_thumb',$settings['tx_thumb']);}
	       				<span class="help-block">红包头像</span>
                    </div>
                </div>
                
                 <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">二维码图片</label>
                    <div class="col-xs-12 col-sm-9">
                         {php echo tpl_form_field_image('qrcode_thumb',$settings['qrcode_thumb']);}
	       				<span class="help-block">二维码图片</span>
                    </div>
                </div>
                
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">地区限制</label>
                    <div class="col-xs-12 col-sm-9">
                        <input type="text" name="iplimit" value="{$settings['iplimit']}" class="form-control">
                        <span class="help-block">输入江苏就全江苏的都可以用，输入南京就只有南京的可以用， 如果不符合地区，暂时跳转到活动结束的链接地址去。</span>
                    </div>
                </div>
                
                   <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">活动是否结束</label>
                    <div class="col-xs-12 col-sm-9">
                        <input type="text" name="end" value="{$settings['end']}" class="form-control">
                <span class="help-block">输入"是"(不加引号) 就是结束，其他无效</span>
						
                    </div>
                </div>
				  <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">活动结束跳转的url链接地址</label>
                    <div class="col-xs-12 col-sm-9">
                        <input type="text" name="endurl" value="{$settings['endurl']}" class="form-control">
                <span class="help-block">输入一个说明地址，比如微信素材地址</span>
						
                    </div>
                </div>
                
                 <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">诱导关注微信号</label>
                    <div class="col-xs-12 col-sm-9">
                        <input type="text" name="weixinid" value="{$settings['weixinid']}" class="form-control">
                        <span class="help-block">诱导关注微信号</span>
                    </div>
                </div>
                
                  <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">显示的微信号名称</label>
                    <div class="col-xs-12 col-sm-9">
                        <input type="text" name="name" value="{$settings['name']}" class="form-control">
                        <span class="help-block">显示的微信号名称</span>
                    </div>
                </div>
                
                    
                 <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">分享地址</label>
                    <div class="col-xs-12 col-sm-9">
                        <input type="text" name="shareurl" value="{$settings['shareurl']}" class="form-control">
                
                    </div>
                </div>
                
                    
                 <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">分享标题</label>
                    <div class="col-xs-12 col-sm-9">
                        <input type="text" name="sharetitle" value="{$settings['sharetitle']}" class="form-control">
              
                    </div>
                </div>
                
                    
                 <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">分享描述</label>
                    <div class="col-xs-12 col-sm-9">
                        <input type="text" name="sharedescription" value="{$settings['sharedescription']}" class="form-control">
            
                    </div>
                </div>
                
                    
                 <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">分享图片</label>
                       <div class="col-xs-12 col-sm-9">
                         {php echo tpl_form_field_image('shareimage',$settings['shareimage']);}
	       				<span class="help-block">分享图片</span>
                    </div>

                </div>
                
                
                
                
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
                    <div class="col-md-2 col-lg-1">
                        <input name="submit" type="submit" value="保存" class="btn btn-primary btn-block" />
                        <input type="hidden" name="token" value="{$_W['token']}" />
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
{template 'common/footer'}
